package com.dwxt.sport.business.view;

import com.dwxt.sport.util.DictUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 首页-分布地图 返回数据
 *
 * @author Kuang.JiaZhuo
 * @date 2020-08-12 16:46
 */
@Data
public class DistributionMapView {

    @ApiModelProperty("名字")
    private String name;

    @ApiModelProperty("街道id")
    private String streetId;

    @ApiModelProperty("街道名")
    private String streetName;

    @ApiModelProperty("经度")
    private String lng;

    @ApiModelProperty("纬度")
    private String lat;

    @ApiModelProperty("是否报警(0:否;1:是)")
    private String isAlarm;

    public String getIsAlarm(){
        if(isAlarm==null){
            return "0";
        }
        return isAlarm;
    }

    @ApiModelProperty("设备分类(关联数据字典【classification】)")
    private String classification;

    @ApiModelProperty("设备分类Display")
    public String getClassificationDisplay(){
        return classification==null?null: DictUtil.getDisplay("classification",classification);
    }

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime createTime;
}
